import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'


Vue.config.productionTip = false

import { Button,Cell,CellGroup } from 'vant';
import { NavBar } from 'vant';
import { Tabbar, TabbarItem ,Toast} from 'vant';
import {Lazyload,Image as VanImage, Icon} from 'vant'

Vue.use(Button);   //全局挂载的方案
Vue.use(Cell);   
Vue.use(CellGroup);   
Vue.use( NavBar );  
Vue.use( Tabbar, );  
Vue.use( TabbarItem );  
Vue.use(Toast)
Vue.use(Lazyload)
Vue.use(VanImage);
Vue.use(Icon);


import axios from './utils/request.js'
Vue.prototype.$http = axios;

import moment from 'moment/moment'
Vue.filter('moment', function (value, formatString) {
    formatString = formatString || 'YYYY-MM-DD HH:mm:ss';
 return moment(value).format(formatString);
});

import mixin from '@/common/mixins'
Vue.mixin(mixin)

import init from '@/common/init'
const app = new Vue({
  router,
  store,
  render: h => h(App)
})

init().then(res=>{
  app.$mount('#app')
})



Vue.prototype.$bus = new Vue()

